
function Coordinate(x,y)
{
	this.x=x;
	this.y=y;
	
	this.getX=function(){
		return this.x;
	}
	
	this.getY=function(){
		return this.y;
	}
	this.toInt=function(){
		var val = (3 * this.x) + this.y;
		return val;
	}
	
	this.equals(c){
		if(this.x==c.x && this.y==c.y)
			return true;
			else
				return false;
	}
	
	this.toString(){
		return "Coordinate:x=" + this.x + ";" + "y=" + this.y;
	}
	
	this.value=function(val){
		var a=val/3;
		var b=val%3;
		var newcoord=new Coordinate(a,b);
		return(newcoord);
	}
	
	this.horizontalNext=function(){
		var horcoord=new Coordinate(this.x,this.y+1);
		return coord;
	}
	
	this.verticalNext=function(){
		var vercoord=new Coordinate(this.x+1,this.y);
		return coord;
	}
	
}